package org.example.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.pojo.Result;
import org.example.pojo.Sound;
import org.example.service.SoundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/home")
@Slf4j
public class HomeController {

    @Autowired
    private SoundService soundService;

    @GetMapping("/sounds")
    public Result<List<Sound>> getSounds() {
        log.info("获取声音列表");
        return Result.success(soundService.getSounds());
    }
} 